# -*- coding: utf-8 -*-
from match import Extractor
import regex as re


class HuiZuiExtractor(Extractor):

    # 悔罪适用于所有罪名，所以直接返回True
    @staticmethod
    def is_my_job(file_path):
        return True

    @staticmethod
    def extract(text):
        result = {}
        have_hui_zui = re.search(r"(悔过|悔罪)", text) is not None
        result["悔罪表现"] = int(have_hui_zui)
        if result["悔罪表现"] == 0:
            result["悔罪表现"] += 2
        return result


if __name__ == '__main__':
    print(HuiZuiExtractor.extract("啊啊"))
